package com.jswlw.service.biz.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jswlw.dao.biz.FeedBackMapper;
import com.jswlw.entity.biz.FeedBack;
import com.jswlw.service.biz.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FeedBackServiceImpl implements FeedBackService {
    @Autowired
    FeedBackMapper mapper;

    @Override
    public void add(FeedBack feedBack) {
        mapper.insertSelective(feedBack);
    }

    @Override
    public void update(FeedBack feedBack) {
        mapper.updateByPrimaryKeySelective(feedBack);
    }

    @Override
    public void delete(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public FeedBack find4Id(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<FeedBack> queryList(FeedBack filter) {
        return mapper.queryList(filter);
    }

    @Override
    public Page<FeedBack> queryPage(FeedBack feedBack, Integer offset, Integer limit) {
        PageHelper.startPage(offset,limit);
        return (Page<FeedBack>) mapper.queryList(feedBack);
    }
}
